<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="pren">上一张</div>
		<img src="https://i.postimg.cc/mgsKJGLw/susu1.jpg" />
		<div id="cren">下一张</div>
	</body>
	<script>
		window.onload = function() {
			var pren = document.getElementById('pren');
			var cren = document.getElementById('cren');

			var img = document.getElementsByTagName('img')[0];
			var srt = ["https://i.postimg.cc/mgsKJGLw/susu1.jpg", "https://i.postimg.cc/qRRLS16Q/susu0.jpg", "https://i.postimg.cc/mgsKJGLw/susu1.jpg", "https://i.postimg.cc/qRRLS16Q/susu0.jpg", ];
			var index = 0;
			pren.onclick = function() {
				index--;
				if (index < 0) {
					index = srt.length - 1;
				}
				img.src = srt[index]
			};
			cren.onclick = function() {
				index++;
				if (index > srt.length - 1) {
					index = 0;
				}
				img.src = srt[index]
			};
		}
	</script>

</html>
